<?php namespace app\admin\controller;

use system\model\User;

class Entry{
    //动作
    public function index(){
        $encrypted = Crypt::encrypt('admin');
        if(IS_POST){
            $res=(new User())->login();
            if(!$res['valid']){
               //p((new User())->getError());die;
                message( $res['message'], $redirect = 'back', $type = 'error', $timeout = 2 );
            }
            message($res['message'],u('admin.admin.index'),'success',2);
        }
        return view();
    }
    //验证码
    public function code(){
        Code::make();
    }
}
